Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--com.sun.java.swing.JComponent | +--com.sun.java.swing.JSplitPane
The two Components can be aligned left to right using
JSplitPane.HORIZONTAL_SPLIT
, or top to bottom using
JSplitPane.VERTICAL_SPLIT
.
The preferred way to change the size of the Components is to invoke
setDividerLocation
where location
is either
the new x or y position, depending on the orientation of the
JSplitPane. If one component changes, JSplitPane also attempts to
reposition the other component.
To resize the Components to their preferred sizes invoke
resetToPreferredSizes
.
When the user is resizing the Components the minimum size of the
Components is used to determine the maximum/minimum position the
Components can be set to. So that if the minimum size of the two
components is greater than the size of the splitpane the divider
will not allow you to resize it. To alter the minimum size of a
JComponent, see JComponent.setMinimumSize
.
For the keyboard keys used by this component in the standard Look and Feel (L&F) renditions, see the JSplitPane key assignments.
Warning: serialized objects of this class will not be compatible with future swing releases. The current serialization support is appropriate for short term storage or RMI between Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.
Inner Class Summary | |
JSplitPane.AccessibleJSplitPane
The class used to obtain the accessible role for this object. |
Inner classes inherited from class com.sun.java.swing.JComponent | |
JComponent.AccessibleJComponent |
Field Summary | |
static java.lang.String | BOTTOM
Used to add a Component below the other Component. |
static java.lang.String | CONTINUOUS_LAYOUT_PROPERTY
Bound property name for continuousLayout. |
boolean | continuousLayout
Whether or not the views are continuously redisplayed while resizing. |
static java.lang.String | DIVIDER_SIZE_PROPERTY
Bound property name for border. |
static java.lang.String | DIVIDER
Used to add a Component that will represent the divider. |
int | dividerSize
Size of the divider. |
static int | HORIZONTAL_SPLIT
Horizontal split indicates the Components are split along the x axis, eg the two Components will be split one to the left of the other. |
static java.lang.String | LAST_DIVIDER_LOCATION_PROPERTY
Bound property for lastLocation. |
int | lastDividerLocation
Previous location of the split pane. |
java.awt.Component | leftComponent
The left or top component. |
static java.lang.String | LEFT
Used to add a Component to the left of the other Component. |
static java.lang.String | ONE_TOUCH_EXPANDABLE_PROPERTY
Bound property for oneTouchExpandable. |
boolean | oneTouchExpandable
Is a little widget provided to quickly expand/collapse the split pane? |
static java.lang.String | ORIENTATION_PROPERTY
Bound property name for orientation (horizontal or vertical). |
int | orientation
How the views are split. |
java.awt.Component | rightComponent
|
static java.lang.String | RIGHT
Used to add a Component to the right of the other Component. |
static java.lang.String | TOP
Used to add a Component above the other Component. |
static int | VERTICAL_SPLIT
Vertical split indicates the Components are split along the y axis, eg the two Components will be split one on top of the other. |
Fields inherited from class com.sun.java.swing.JComponent | |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
JSplitPane()
Returns a new JSplitPane configured to arrange the child components side-by-side horizontally with no continuous layout, using two buttons for the compoents. |
|
JSplitPane(int newOrientation)
Returns a new JSplitPane configured with the specified orientation and no continuous layout. |
|
JSplitPane(int newOrientation,
boolean newContinuousLayout)
Returns a new JSplitPane with the specified orientation and redrawing style. |
|
JSplitPane(int newOrientation,
java.awt.Component newLeftComponent,
java.awt.Component newRightComponent)
Returns a new JSplitPane with the specified orientation and with the specifiied components that does not do continuous redrawing. |
|
JSplitPane(int newOrientation,
boolean newContinuousLayout,
java.awt.Component newLeftComponent,
java.awt.Component newRightComponent)
Returns a new JSplitPane with the specified orientation and redrawing style, and with the specifiied components. |
Method Summary | |
void | addImpl(java.awt.Component comp,
java.lang.Object constraints,
int index)
If constraints identifies the left/top or
right/bottom child component, and a component with that identifier
was previously added, it will be removed and then comp
will be added in its place. |
AccessibleContext | getAccessibleContext()
Get the AccessibleContext associated with this JComponent |
java.awt.Component | getBottomComponent()
Returns the component below, or to the right of the divider. |
int | getDividerLocation()
Returns the location of the divider from the look and feel implementation. |
int | getDividerSize()
Returns the size of the divider. |
int | getLastDividerLocation()
Returns the last location the divider was at. |
java.awt.Component | getLeftComponent()
Returns the component to the left (or above) the divider. |
int | getMaximumDividerLocation()
Returns the maximum location of the divider from the look and feel implementation. |
int | getMinimumDividerLocation()
Returns the minimum location of the divider from the look and feel implementation. |
int | getOrientation()
Returns the orientation. |
java.awt.Component | getRightComponent()
Returns the component to the right (or below) the divider. |
java.awt.Component | getTopComponent()
Returns the component above, or to the left of the divider. |
java.lang.String | getUIClassID()
Returns the name of the L&F class that renders this component. |
com.sun.java.swing.plaf.SplitPaneUI | getUI()
Returns the SplitPaneUI that is providing the current look and feel. |
boolean | isContinuousLayout()
Returns true if the child comopnents are continuously redisplayed and layed out during user intervention. |
boolean | isOneTouchExpandable()
Returns true if the pane provides a UI widget to collapse/expand the divider. |
void | paintChildren(java.awt.Graphics g)
Subclassed to message the UI with finishedPaintingChildren after super has been messaged, as well as painting the border. |
void | removeAll()
Removes all the child components from the receiver. |
void | remove(java.awt.Component component)
Removes the child component, component from the
pane. |
void | remove(int index)
Removes the Component at the specified index. |
void | resetToPreferredSizes()
Messaged to relayout the JSplitPane based on the preferred size of the children components. |
void | setBottomComponent(java.awt.Component comp)
Sets the component below, or to the right of the divider. |
void | setContinuousLayout(boolean newContinuousLayout)
Sets whether or not the child components are continuously redisplayed and layed out during user intervention. |
void | setDividerLocation(double proportionalLocation)
Sets the divider location as a percentage of the JSplitPane's size. |
void | setDividerLocation(int location)
Sets the location of the divider. |
void | setDividerSize(int newSize)
Sets the size of the divider. |
void | setLastDividerLocation(int newLastLocation)
Sets the last location the divider was at to newLastLocation . |
void | setLeftComponent(java.awt.Component comp)
Sets the component to the left (or above) the divider. |
void | setOneTouchExpandable(boolean newValue)
Determines whether the JSplitPane provides a UI widget on the divider to quickly expand/collapse the divider. |
void | setOrientation(int orientation)
Sets the orientation, or how the splitter is divided. |
void | setRightComponent(java.awt.Component comp)
Sets the component to the right (or below) the divider. |
void | setTopComponent(java.awt.Component comp)
Sets the component above, or to the left of the divider. |
void | setUI(com.sun.java.swing.plaf.SplitPaneUI ui)
Sets the L&F object that renders this component. |
void | updateUI()
Notification from the UIManager that the L&F has changed. |
Methods inherited from class java.awt.Container | |
add, add, add, add, add, addContainerListener, addImpl, addNotify, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponentAt, getComponentAt, getComponent, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paint, paramString, preferredSize, printComponents, print, processContainerEvent, processEvent, removeAll, remove, remove, removeContainerListener, removeNotify, setLayout, update, validate, validateTree |
Methods inherited from class java.awt.Component | |
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
public static final int VERTICAL_SPLIT
public static final int HORIZONTAL_SPLIT
public static final java.lang.String LEFT
public static final java.lang.String RIGHT
public static final java.lang.String TOP
public static final java.lang.String BOTTOM
public static final java.lang.String DIVIDER
public static final java.lang.String ORIENTATION_PROPERTY
public static final java.lang.String CONTINUOUS_LAYOUT_PROPERTY
public static final java.lang.String DIVIDER_SIZE_PROPERTY
public static final java.lang.String ONE_TOUCH_EXPANDABLE_PROPERTY
public static final java.lang.String LAST_DIVIDER_LOCATION_PROPERTY
protected int orientation
protected boolean continuousLayout
protected java.awt.Component leftComponent
protected java.awt.Component rightComponent
protected int dividerSize
protected boolean oneTouchExpandable
protected int lastDividerLocation
Constructor Detail |
public JSplitPane()
public JSplitPane(int newOrientation)
newOrientation
- an int specifying the horizontal or vertical
orientationpublic JSplitPane(int newOrientation, boolean newContinuousLayout)
newOrientation
- an int specifying the horizontal or vertical
orientation
newContinuousLayout
- a boolean, true for the components to
redraw continuously as the divider changes position, false
to wait until the divider position stops changing to redrawpublic JSplitPane(int newOrientation, java.awt.Component newLeftComponent, java.awt.Component newRightComponent)
newOrientation
- an int specifying the horizontal or vertical
orientation
newContinuousLayout
- a boolean, true for the components to
redraw continuously as the divider changes position, false
to wait until the divider position stops changing to redraw
newLeftComponent
- the Component that will appear on the left
of a horizontally-split pane, or at the top of a
vertically-split pane.public JSplitPane(int newOrientation, boolean newContinuousLayout, java.awt.Component newLeftComponent, java.awt.Component newRightComponent)
newOrientation
- an int specifying the horizontal or vertical
orientation
newContinuousLayout
- a boolean, true for the components to
redraw continuously as the divider changes position, false
to wait until the divider position stops changing to redraw
newLeftComponent
- the Component that will appear on the left
of a horizontally-split pane, or at the top of a
vertically-split pane.Method Detail |
public void setUI(com.sun.java.swing.plaf.SplitPaneUI ui)
ui
- the SplitPaneUI L&F objectpublic com.sun.java.swing.plaf.SplitPaneUI getUI()
public void updateUI()
public java.lang.String getUIClassID()
public void setDividerSize(int newSize)
newSize
- an int giving the size of the divider in pixelspublic int getDividerSize()
public void setLeftComponent(java.awt.Component comp)
comp
- the Component to display in that positionpublic java.awt.Component getLeftComponent()
public void setTopComponent(java.awt.Component comp)
comp
- the Component to display in that positionpublic java.awt.Component getTopComponent()
public void setRightComponent(java.awt.Component comp)
comp
- the Component to display in that positionpublic java.awt.Component getRightComponent()
public void setBottomComponent(java.awt.Component comp)
comp
- the Component to display in that positionpublic java.awt.Component getBottomComponent()
public void setOneTouchExpandable(boolean newValue)
newValue
- a boolean, where true means to provide a
collapse/expand widgetpublic boolean isOneTouchExpandable()
public void setLastDividerLocation(int newLastLocation)
newLastLocation
.
newLastLocation
- an int specifying the last divider location
in pixels, from the left (or upper) edge of the pane to the
left (or upper) edge of the dividerpublic int getLastDividerLocation()
public void setOrientation(int orientation)
orientation
- an int specifying the orientationpublic int getOrientation()
public void setContinuousLayout(boolean newContinuousLayout)
newContinuousLayout
- a boolean, true if the components
are continuously redrawn as the divider changes positionpublic boolean isContinuousLayout()
public void resetToPreferredSizes()
public void setDividerLocation(double proportionalLocation)
proportionalLocation
- a double-precision floating point value that
specifies a percentage, from zero (top/left) to 1.0 (bottom/right)public void setDividerLocation(int location)
location
- an int specifying a UI-specific value (typically a
pixel count)public int getDividerLocation()
public int getMinimumDividerLocation()
public int getMaximumDividerLocation()
public void remove(java.awt.Component component)
component
from the
pane. Resets the leftComponent or rightComponent instance
variable, as necessary.
component
- the Component to removepublic void remove(int index)
index
- an int specifying the component to remove, where
0 specifies the left/top component and 1 specifies the
bottom/right componentpublic void removeAll()
protected void addImpl(java.awt.Component comp, java.lang.Object constraints, int index)
constraints
identifies the left/top or
right/bottom child component, and a component with that identifier
was previously added, it will be removed and then comp
will be added in its place. If constraints
is not
one of the known identifers the layout manager may throw an
IllegalArgumentException.
The possible constraints objects (Strings) are:
comp
- the component to add
constraints
- an Object specifying the layout constraints
(position) for this component
index
- an int specifying the index in the container's
list.protected void paintChildren(java.awt.Graphics g)
g
- the Graphics context within which to paintpublic AccessibleContext getAccessibleContext()
Overview | Package | Class | Tree | Deprecated | Index | Help |
Java Platform 1.1.7 |
||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |